package com.winning.bdu.dl.quartz.jobs;

import com.winning.bdu.dl.quartz.base.BaseJob;
import com.winning.bdu.dl.service.IDataLoadService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author: shipengfei
 * @Description:
 * @Date: 2019-06-04 10:07
 */
@Slf4j
public class DataloadJob extends BaseJob {

    @Autowired
    private IDataLoadService dataLoadService;

    /**
     * 执行业务操作
     *
     * @param context
     */
    @Override
    protected void doJob(JobExecutionContext context) {
        log.info("定时加载数据开始！");
        long startTime = System.currentTimeMillis();
        dataLoadService.dumpTableData();
        long endTime = System.currentTimeMillis();
        log.info("定时加载数据结束！耗时{}ms", (endTime - startTime));
    }
}
